home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / libs / x / xview / xview3.004 / xview3 / usr / X11R6 / lib / X11 / config / XView.rules < prev    next >
Encoding:
Text File  |  1996-05-30  |  18.8 KB  |  587 lines

  1. /**/###########################################################################
  2. /**/# @(#)XView.rules    1.8 12 May 1993 SMI
  3. /**/# XView.rules for XView release 3.0.  Imake rules needed by distribution.
  4.  
  5. /*
  6.  ***********************************************************************
  7.  *
  8.  *    Imake rules for XView
  9.  *    *** DO NOT CHANGE ANYTHING BELOW THIS LINE! ***
  10.  *
  11.  ***********************************************************************
  12.  */
  13. /*
  14.  * SubdirNormalLibTarget - create an "all::" target for a library;
  15.  */
  16. #ifndef SubdirNormalLibTarget
  17. #define SubdirNormalLibTarget(libname, objlist)                @@\
  18. AllTarget(lib/**/libname.a)                        @@\
  19.                                     @@\
  20. lib/**/libname.a:: objlist                        @@\
  21.     $(AR) $(TARGETDIR)$@ objlist
  22.  
  23. #endif /* SubdirNormalLibTarget */
  24.  
  25. /*
  26.  * SubdirProfiledLibTarget - create an "all::" target for a profiled library;
  27.  */
  28. #ifndef SubdirProfiledLibTarget
  29. #define SubdirProfiledLibTarget(libname, objlist)            @@\
  30. AllTarget(lib/**/libname/**/_p.a)                    @@\
  31.                                     @@\
  32. lib/**/libname/**/_p.a:: objlist                    @@\
  33.     ( cd profiled; $(AR) ../$(TARGETDIR)$@ objlist )
  34.  
  35. #endif /* SubdirProfiledLibTarget */
  36.  
  37. /*
  38.  * SubdirDebuggedLibTarget - create an "all::" target for a debugged library;
  39.  */
  40. #ifndef SubdirDebuggedLibTarget
  41. #define SubdirDebuggedLibTarget(libname, objlist)            @@\
  42. AllTarget(lib/**/libname/**/_d.a)                    @@\
  43.                                     @@\
  44. lib/**/libname/**/_d.a:: objlist                    @@\
  45.     ( cd debugger; $(AR) ../$(TARGETDIR)$@ objlist )
  46.  
  47. #endif /* SubdirDebuggedLibTarget */
  48.  
  49. /*
  50.  * SubdirCompoundLibTarget - create an "all::" target for a compound library;
  51.  * --same rule as SubdirNormalLibTarget--compatibility
  52.  */
  53. #ifndef SubdirCompoundLibTarget
  54. #define SubdirCompoundLibTarget(libname, objlist)            @@\
  55. AllTarget(lib/**/libname.a)                        @@\
  56.                                     @@\
  57. lib/**/libname.a:: objlist                        @@\
  58.     $(AR) $(TARGETDIR)$@ objlist
  59.  
  60. #endif /* SubdirCompoundLibTarget */
  61.  
  62. /* 
  63.  * MakeAnythingSubdirs - go into subdirs to make anything for a given target;
  64.  */
  65. #ifndef MakeAnythingSubdirs
  66. #define MakeAnythingSubdirs(name,dirs)                    @@\
  67. name::                                    @@\
  68.     @case '${MFLAGS}' in *[ik]*) set +e;; esac; \            @@\
  69.     for i in dirs ;\                        @@\
  70.     do \                                @@\
  71.         (cd $$i ; echo "making name in $$i"; \            @@\
  72.             $(MAKE) PassCDebugFlags $(MFLAGS) name); \    @@\
  73.     done
  74.  
  75. #endif /* MakeAnythingSubdirs */
  76.  
  77. /*
  78.  * InstallLibraryNoBuild - install a library without first trying to build it;
  79.  * Check if need to do ranlib
  80.  */
  81. #if DoRanlibCmd
  82.  
  83. #ifndef InstallLibraryNoBuild
  84. #define    InstallLibraryNoBuild(libname,dest)                @@\
  85. install::                                 @@\
  86.     -$(INSTALL) -c $(INSTLIBFLAGS) lib/**/libname.a dest        @@\
  87.     -$(RANLIB) $(RANLIBINSTFLAGS) dest/lib/**/libname.a
  88.  
  89. #endif /* InstallLibraryNoBuild */
  90.  
  91. #else /* DoRanlibCmd */
  92.  
  93. #ifndef InstallLibraryNoBuild
  94. #define    InstallLibraryNoBuild(libname,dest)                @@\
  95. install::                                 @@\
  96.     -$(INSTALL) -c $(INSTLIBFLAGS) lib/**/libname.a dest
  97. #endif /* InstallLibraryNoBuild */
  98.  
  99. #endif /* DoRanlibCmd */
  100.  
  101. /*
  102.  * SubdirNormalSharedLibraryTarget - generate rules to create a shared library;
  103.  * do not build it since this is for a subdirectory.  Move the files to the
  104.  * shared library directory for all objects in solist.
  105.  */
  106. #ifndef SubdirNormalSharedLibraryTarget
  107. #define SubdirNormalSharedLibraryTarget(libname,rev,solist,dir,sub)    @@\
  108. AllTarget(lib/**/libname.so.rev)                    @@\
  109.                                     @@\
  110. lib/**/libname.so.rev::  solist                        @@\
  111.     -@if [ ! -d dir ]; then mkdir dir; else exit 0; fi        @@\
  112.     @case '${MFLAGS}' in *[i]*) set +e;; esac; \            @@\
  113.     for i in solist; do (set -x; $(CP) sub/$$i dir; $(CP) sub/$$i .); done
  114.  
  115. #endif /* SubdirNormalSharedLibraryTarget */
  116.  
  117. /*
  118.  * SubdirNormalSharedLibraryDataTarget - generate rules to create shlib data file;
  119.  * do not build it since this is for a subdirectory.  Copy the files to the
  120.  * shared library data directory for all objects in salist.  Delete the
  121.  * unneeded data modules from the ./shared directory.
  122.  */
  123. #ifndef SubdirNormalSharedLibraryDataTarget
  124. #ifdef __linux
  125. #define SubdirNormalSharedLibraryDataTarget(libname,rev,salist,dir,sub)
  126. #else /* __linux */
  127. #define SubdirNormalSharedLibraryDataTarget(libname,rev,salist,dir,sub)    @@\
  128. AllTarget(lib/**/libname.sa.rev)                    @@\
  129.                                     @@\
  130. lib/**/libname.sa.rev::  salist                        @@\
  131.     -@if [ ! -d dir ]; then mkdir dir; else exit 0; fi        @@\
  132.     @case '${MFLAGS}' in *[i]*) set +e;; esac; \            @@\
  133.     for i in salist; do \                        @@\
  134.     (set -x; $(CP) sub/$$i dir; $(CP) shared/$$i $(SHARED_DIR)); done
  135.  
  136. #endif /* !__linux */
  137. #endif /* SubdirNormalSharedLibraryDataTarget */
  138.  
  139.  
  140. /*
  141.  * SubdirBuildNormalSharedLibraryTarget - generate rules to create a shared library;
  142.  * build it into a different name so that the we don't hose people by having
  143.  * the library gone for long periods.  The lib<foo>.so part contains the entire
  144.  * library both text and data modules.  The globally initialized data must be
  145.  * included in both the .so and the .sa parts of the library.
  146.  */
  147. #ifndef SubdirBuildNormalSharedLibraryTarget
  148. #ifdef __linux
  149.  
  150. #define SubdirBuildNormalSharedLibraryTarget(libname,rev,solist,sodir)        @@\
  151. AllTarget(lib/**/libname.so.rev)                    @@\
  152.                                     @@\
  153. lib/**/libname.so.rev:: solist                         @@\
  154.     $(RM) $@~    @@\
  155.     (cd sodir; $(CC) -shared -Wl,-soname -Wl,`basename $@ | sed 's/\(\.[0-9]\).*$$/\1/'` -o $@~ ?*.o) @@\
  156.     $(RM) $@ @@\
  157.     $(MV) sodir/$@~ $@ @@\
  158. @@\
  159. @@\
  160. clean::    @@\
  161.     $(RM) lib/**/libname.so.rev sodir/?*.o
  162.  
  163. #else /* __linux */
  164.  
  165. #define SubdirBuildNormalSharedLibraryTarget(libname,rev,solist,sodir)        @@\
  166. AllTarget(lib/**/libname.so.rev)                    @@\
  167.                                     @@\
  168. lib/**/libname.so.rev:: solist                         @@\
  169.     $(RM) $@~ sodir/lib/**/libname.so.xs.o                @@\
  170.     @if [ -f xstrings ]; then \                                     @@\
  171.             $(RM) strings; $(CP) xstrings strings; fi               @@\
  172.     (cd sodir; $(LD) -o ../$@~ $(SHLIBLDFLAGS) ?*.o)        @@\
  173.     -@if [ -f strings~ ]; then $(RM) strings~; else exit 0; fi    @@\
  174.     $(RM) $@                              @@\
  175.     $(MV) $@~ $@                            @@\
  176.                                     @@\
  177. clean::                                    @@\
  178.     $(RM) lib/**/libname.so.rev sodir/?*.o strings*
  179.  
  180. #endif /* !__linux */
  181.  
  182. #endif /* SubdirBuildNormalSharedLibraryTarget */
  183.  
  184. /*
  185.  * SubdirBuildSortedSharedLibraryTarget - rules to create a sorted shlib;
  186.  * build it into a different name so that the we don't hose people by having
  187.  * the library gone for long periods.  The lib<foo>.so part contains the entire
  188.  * library both text and data modules.  The globally initialized data must be
  189.  * included in both the .so and the .sa parts of the library.  Must have the
  190.  * sorting script and a list of objects to sort.
  191.  */
  192. #ifndef SubdirBuildSortedSharedLibraryTarget
  193. #ifdef __linux
  194.  
  195. #define SubdirBuildSortedSharedLibraryTarget(libname,rev,solist,sodir,objsort,objlist) \
  196.         SubdirBuildNormalSharedLibraryTarget(libname,rev,solist,sodir)
  197.  
  198. #else /* __linux */
  199.  
  200. #define SubdirBuildSortedSharedLibraryTarget(libname,rev,solist,sodir,objsort,objlist) @@\
  201. AllTarget(lib/**/libname.so.rev)                    @@\
  202.                                     @@\
  203. lib/**/libname.so.rev:: solist                         @@\
  204.     $(RM) $@~ sodir/lib/**/libname.so.xs.o                @@\
  205.     @if [ -f xstrings ]; then \                                     @@\
  206.             $(RM) strings; $(CP) xstrings strings; fi               @@\
  207.     -@if [ ! -x objsort ];then $(CHMOD) 755 objsort;else exit 0;fi    @@\
  208.     $(LD) `objsort objlist sodir` -o $@~ $(SHLIBLDFLAGS)         @@\
  209.     @if [ -f strings~ ]; then $(RM) strings~; else exit 0; fi    @@\
  210.     $(RM) $@                              @@\
  211.     $(MV) $@~ $@                            @@\
  212.                                     @@\
  213. clean::                                    @@\
  214.     $(RM) lib/**/libname.so.rev sodir/?*.o strings* xstrings*
  215.  
  216. #endif /* !__linux */
  217. #endif /* SubdirBuildSortedSharedLibraryTarget */
  218.  
  219. /*
  220.  * SubdirBuildNormalSharedLibraryDataTarget - generate rules to create shlib data file;
  221.  * Do not use xstr or pic on the data file segments.
  222.  * The lib<foo>.sa part defines the interface for globally initialized data.
  223.  * Check if ranlib is needed.
  224.  */
  225. #if DoRanlibCmd
  226.  
  227. #ifndef SubdirBuildNormalSharedLibraryDataTarget
  228.  
  229. #ifdef __linux
  230. #define SubdirBuildNormalSharedLibraryDataTarget(libname,rev,sadir)
  231.  
  232. #else /* __linux */
  233.  
  234. #define SubdirBuildNormalSharedLibraryDataTarget(libname,rev,sadir)    @@\
  235. AllTarget(lib/**/libname.sa.rev)                    @@\
  236.                                     @@\
  237. lib/**/libname.sa.rev::                          @@\
  238.     $(RM) $@~                            @@\
  239.     (cd sadir; $(AR) ../$@~ ?*.o)                    @@\
  240.     $(RM) $@                             @@\
  241.     $(MV) $@~ $@                            @@\
  242.     $(RANLIB) $@                            @@\
  243.                                     @@\
  244. clean::                                    @@\
  245.     $(RM) lib/**/libname.sa.rev sadir/?*.o
  246.  
  247. #endif /* !__linux */
  248. #endif /* SubdirBuildNormalSharedLibraryDataTarget */
  249.  
  250. #else /* DoRanlibCmd */
  251.  
  252. #ifndef SubdirBuildNormalSharedLibraryDataTarget
  253. #ifdef __linux
  254. #define SubdirBuildNormalSharedLibraryDataTarget(libname,rev,sadir)
  255. #else /* __linux */
  256. #define SubdirBuildNormalSharedLibraryDataTarget(libname,rev,sadir)    @@\
  257. AllTarget(lib/**/libname.sa.rev)                    @@\
  258.                                     @@\
  259. lib/**/libname.sa.rev::                          @@\
  260.     $(RM) $@~                            @@\
  261.     (cd sadir; $(AR) ../$@~ ?*.o)                    @@\
  262.     $(RM) $@                             @@\
  263.     $(MV) $@~ $@                            @@\
  264.                                     @@\
  265. clean::                                    @@\
  266.     $(RM) lib/**/libname.sa.rev sadir/?*.o
  267.  
  268. #endif /* SubdirBuildNormalSharedLibraryDataTarget */
  269.  
  270. #endif /* !__linux */
  271. #endif /* DoRanlibCmd */
  272.  
  273. /*
  274.  * SubdirSharedLibraryObjectRule - generate make rules to build 
  275.  * "normal" SunOS style shared object files.  XView absolutely requires
  276.  * the use of xstr to build a shared library; otherwise, the library will
  277.  * overflow the GLOBAL_OFFSET_TABLE for some architectures.
  278.  */
  279. #ifndef SubdirSharedLibraryObjectRule
  280. #define SubdirSharedLibraryObjectRule()                    @@\
  281. all::                                    @@\
  282.     -@if [ ! -d shared ]; then mkdir shared; else exit 0; fi    @@\
  283.     -@if [ ! -f $(XSTR_STRINGS_FILE) ]; then \                      @@\
  284.         touch $(XSTR_STRINGS_FILE);  else exit 0; fi            @@\
  285.     -@if [ ! -f strings ]; then \                                   @@\
  286.         $(LN) $(XSTR_STRINGS_FILE) strings; else exit 0; fi     @@\
  287.                                     @@\
  288. .c.o:                                    @@\
  289.     $(RM) $@ shared/$@                        @@\
  290.     $(CC) $(PIC) $(SHAREDCODEDEF) $(SHLIBDEF) $(CFLAGS) $(STRCONST) -c $*.c \    @@\
  291.         -o shared/$*.o                        @@\
  292.                                     @@\
  293. clean::                                    @@\
  294.     $(RM) strings*                            @@\
  295.     -@if [ -d shared ]; then echo "    $(RM) shared/?*.o"; \        @@\
  296.         $(RM) shared/?*.o; else exit 0; fi            @@\
  297.  
  298. #endif /* SubdirSharedLibraryObjectRule */
  299.  
  300. /*
  301.  * SubdirSharedAndDebuggedLibraryObjectRule - generate make rules to build shared,
  302.  * debuggable, and "normal" object files.
  303.  */
  304. #ifndef SubdirSharedAndDebuggedLibraryObjectRule
  305. #define SubdirSharedAndDebuggedLibraryObjectRule()                @@\
  306. all::                                    @@\
  307.     -@if [ ! -d shared ]; then mkdir shared; else exit 0; fi    @@\
  308.     -@if [ ! -f $(XSTR_STRINGS_FILE) ]; then \                      @@\
  309.         touch $(XSTR_STRINGS_FILE);  else exit 0; fi            @@\
  310.     -@if [ -f strings ]; then $(RM) strings; else exit 0; fi        @@\
  311.     $(LN) $(XSTR_STRINGS_FILE) strings                              @@\
  312.     -@if [ ! -d debugger ]; then mkdir debugger; else exit 0; fi    @@\
  313.                                     @@\
  314. .c.o:                                    @@\
  315.     $(RM) $@ shared/$@ debugger/$@                    @@\
  316.     $(CC) -g -c $(SHLIBDEF) $(CFLAGS) $(STRCONST) $*.c        @@\
  317.     $(CP) $*.o debugger/$*.o                    @@\
  318.     $(CC) -c $(SHLIBDEF) $(CFLAGS) $(STRCONST) $*.c                @@\
  319.                                     @@\
  320. clean::                                    @@\
  321.     $(RM) strings*                                                  @@\
  322.     -@if [ -d shared ]; then echo "    $(RM) shared/?*.o"; \        @@\
  323.         $(RM) shared/?*.o; else exit 0; fi            @@\
  324.     -@if [ -d debugger ]; then echo "    $(RM) debugger/?*.o"; \ @@\
  325.         $(RM) debugger/?*.o; else exit 0; fi            @@\
  326.  
  327. #endif /* SubdirSharedAndDebuggedLibraryObjectRule */
  328.  
  329. /*
  330.  * SubdirSpecialSharedAndDebuggedObjectRule - generate rules to compile a file 
  331.  * with special flags and to make shared and debuggable versions.
  332.  * This rule does not use xstr so it may be used for data modules.
  333.  */
  334. #ifndef SubdirSpecialSharedAndDebuggedObjectRule
  335. #define    SubdirSpecialSharedAndDebuggedObjectRule(objs,depends,options)    @@\
  336. all::                                    @@\
  337.     -@if [ ! -d shared ]; then mkdir shared; else exit 0; fi    @@\
  338.     -@if [ ! -d debugger ]; then mkdir debugger; else exit 0; fi    @@\
  339.                                     @@\
  340. objs:    depends                                @@\
  341.     $(RM) $@ shared/$@ debugger/$@                    @@\
  342.     $(CC) $(PIC) -c $(SHAREDCODEDEF) $(SHLIBDEF) $(CFLAGS) options $*.c @@\
  343.     $(CP) $*.o shared/$*.o                        @@\
  344.     $(CC) -g -c $(SHLIBDEF) $(CFLAGS) options $*.c            @@\
  345.     $(CP) $*.o debugger/$*.o                    @@\
  346.     $(CC) -c $(SHLIBDEF) $(CFLAGS) options $*.c
  347.  
  348. #endif /* SubdirSpecialDebuggedAndProfiledObjectRule */
  349.  
  350. /*
  351.  * SubdirSpecialSharedObjectRule - generate rules to compile a file 
  352.  * with special flags and to make shared versions.
  353.  * This rule does not use xstr so it may be used for data modules.
  354.  */
  355. #ifndef SubdirSpecialSharedObjectRule
  356. #define    SubdirSpecialSharedObjectRule(objs,depends,options)        @@\
  357. all::                                    @@\
  358.     -@if [ ! -d shared ]; then mkdir shared; else exit 0; fi    @@\
  359.                                     @@\
  360. objs:    depends                                @@\
  361.     $(RM) $@ shared/$@                         @@\
  362.     $(CC) $(PIC) -c $(SHAREDCODEDEF) $(SHLIBDEF) $(CFLAGS) options $*.c @@\
  363.     $(CP) $*.o shared/$*.o                        @@\
  364.     $(CC) -c $(SHLIBDEF) $(CFLAGS) options $*.c
  365.  
  366. #endif /* SubdirSpecialSharedObjectRule */
  367.  
  368. /*
  369.  * AssemblerObjectRule - generate an object rule for assembler sources
  370.  */
  371. #ifndef AssemblerObjectRule
  372. #define AssemblerObjectRule(objs,depends)                @@\
  373.                                     @@\
  374. objs:    depends                                @@\
  375.     $(AS) $(AFLAGS) $*.s -o $*.o 
  376.  
  377. #endif /* AssemblerObjectRule */
  378.  
  379. /*
  380.  * InstallSharedLibraryDataNoBuild - rules to install the shared library data
  381.  * Check if ranlib is needed
  382.  */
  383. #ifdef __linux
  384. #define    InstallSharedLibraryDataNoBuild(libname,rev,dest)
  385. #else /* __linux */
  386. #if DoRanlibCmd
  387.  
  388. #ifndef InstallSharedLibraryDataNoBuild
  389. #define    InstallSharedLibraryDataNoBuild(libname,rev,dest)        @@\
  390. install::                                 @@\
  391.     -$(INSTALL) -c $(INSTSHAREDLIBFLAGS) lib/**/libname.sa.rev dest    @@\
  392.     -$(RANLIB) $(RANLIBINSTFLAGS) dest/lib/**/libname.sa.rev
  393.     
  394.  
  395. #endif /* InstallSharedLibraryDataNoBuild */
  396.  
  397. #else /* DoRanlibCmd */
  398.  
  399. #ifndef InstallSharedLibraryDataNoBuild
  400. #define    InstallSharedLibraryDataNoBuild(libname,rev,dest)        @@\
  401. install::                                 @@\
  402.     -$(INSTALL) -c $(INSTSHAREDLIBFLAGS) lib/**/libname.sa.rev dest
  403.  
  404. #endif /* InstallSharedLibraryDataNoBuild */
  405.  
  406. #endif /* DoRanlibCmd */
  407. #endif /* __linux */
  408.  
  409. /*
  410.  * InstallSharedLibraryNoBuild - generate rules to install the shared library.
  411.  */
  412. #ifndef InstallSharedLibraryNoBuild
  413. #define    InstallSharedLibraryNoBuild(libname,rev,dest)                @@\
  414. install::                                  @@\
  415.     $(RM) /dest/lib/**/libname.so                                   @@\
  416.     $(INSTALL) -c $(INSTSHAREDLIBFLAGS) lib/**/libname.so.rev dest    @@\
  417.     (cd dest; $(LN) lib/**/libname.so.rev lib/**/libname.so)    @@\
  418.     ldconfig
  419.  
  420. #endif /* InstallSharedLibraryNoBuild */
  421.  
  422. /*
  423.  * SubdirLintLibraryTarget - rules to build a lint library when have subdirs;
  424.  */
  425. #ifndef SubdirLintLibraryTarget
  426. #define SubdirLintLibraryTarget(libname,destdir,srcs)            @@\
  427. lintlib::                                @@\
  428.     -@if [ ! -d destdir ]; then mkdir destdir; else exit 0; fi    @@\
  429.     $(RM) ?*.ln;                            @@\
  430.     @case '${MFLAGS}' in *[ik]*) set +e;; esac; \            @@\
  431.     for i in srcs ;\                        @@\
  432.     do \                                @@\
  433.         echo "linting $$i"; \                    @@\
  434.         $(LINT) $(LINTFLAGS) -i -c $$i; \             @@\
  435.         if [ ! -f ?*.ln ]; then \                @@\
  436.             echo "lint failed for $$i"; \            @@\
  437.         else \                            @@\
  438.             $(MV) ?*.ln destdir; \                @@\
  439.         fi \                            @@\
  440.     done
  441. #endif /* SubdirLintLibraryTarget */
  442.  
  443.  
  444. /*
  445.  * SubdirLintLibraryBuild - rules to create a lint library with subdirs;
  446.  * Note that the lint library is always forced to be newer than the library 
  447.  * itself.
  448.  */
  449. #ifndef SubdirLintLibraryBuild
  450. #define    SubdirLintLibraryBuild(libname,lintdir)                @@\
  451. lintlib:: llib-l/**/libname.ln                        @@\
  452.                                     @@\
  453. llib-l/**/libname.ln:                             @@\
  454.     $(RM) $@                            @@\
  455.     $(LINT) $(LINTLIBFLAG)/**/libname $(LINTFLAGS) lintdir/?*.ln    @@\
  456.                                     @@\
  457. clean::                                    @@\
  458.     $(RM) llib-l/**/libname.ln                    @@\
  459.     $(RM) lint/?*.ln                        @@\
  460.                                     @@\
  461. install.ln:: lintlib
  462. #endif /* LintLibraryBuild */
  463.  
  464. /*
  465.  * PopulateSCCSTree - rule to populate build tree from an SCCS archive
  466.  */
  467. #ifndef PopulateSCCSTree
  468. #define PopulateSCCSTree(type,srcs)                    @@\
  469. populate::                                @@\
  470.     @case '${MFLAGS}' in *[i]*) set +e;; esac;             @@\
  471.     -@if [ -type SCCS ]; then \                    @@\
  472.         for i in srcs ; do sccs get $$i ; done ; \        @@\
  473.     elif [ -type SCCS- ]; then \                    @@\
  474.         $(MV) SCCS- SCCS ; \                    @@\
  475.         for i in srcs ; do sccs get $$i ; done ; \        @@\
  476.         $(MV) SCCS SCCS- ; \                    @@\
  477.     else \                                @@\
  478.         echo "SCCS or SCCS- do not exist" ; \            @@\
  479.     fi
  480. #endif /* PopulateSCCSTree */
  481.  
  482. /*
  483.  * PopulateSubdirs - generate rules to recursively populate a source tree.
  484.  */
  485. #ifndef PopulateSubdirs
  486. #define PopulateSubdirs(dirs)                        @@\
  487. NamedTargetSubdirs(populate,dirs,"populating", /**/,populate)
  488. #endif /* PopulateSubdirs */
  489.  
  490. /*
  491.  * LinkToFile - rule to make a link to one file
  492.  */
  493. #ifndef LinkToFile
  494. #define LinkToFile(step,filename,linkname,dir)                @@\
  495. step:: filename                                @@\
  496.     @case '${MFLAGS}' in *[i]*) set +e;; esac;             @@\
  497.     -@if [ ! -f dir/linkname ]; then \                @@\
  498.         echo "linking dir/linkname to filename..." \        @@\
  499.         echo "  cd" dir; cd dir ; $(RM) linkname ; \        @@\
  500.         (set -x; $(LN) filename linkname); \            @@\
  501.     else \                                @@\
  502.         echo "dir/linkname exists, no link made." ; \        @@\
  503.     fi
  504. #endif /* LinkToFile */
  505.  
  506. /*
  507.  * StartNamedTarget - rule to enter a directory and start a target
  508.  */
  509. #ifndef StartNamedTarget
  510. #define StartNamedTarget(step,dir,flags)                @@\
  511. step::                                     @@\
  512.     (cd dir ; $(MAKE) $(MFLAGS) flags step );
  513. #endif /* StartNamedTarget */
  514.  
  515. /*
  516.  * InstallSupportList - rule to install a list of support files
  517.  */
  518. #ifndef InstallSupportList
  519. #define InstallSupportList(srcs,dest)                    @@\
  520. install::                                @@\
  521.     @case '${MFLAGS}' in *[i]*) set +e;; esac;             @@\
  522.     for i in srcs ;\                        @@\
  523.     do \                                @@\
  524.         echo "installing $$i"; \                @@\
  525.         $(RM) dest/$$i dest/.$$i; \                @@\
  526.         $(INSTALL) -c $(INSTDATFLAGS) $$i dest ; \         @@\
  527.         ( cd dest; $(MV) $$i .$$i; $(LN) .$$i $$i ); \        @@\
  528.     done
  529. #endif /* InstallSupportList */
  530.  
  531. /*
  532.  * InstallNonExecList - rule to install a list of help files
  533.  */
  534. #ifndef InstallNonExecList
  535. #define InstallNonExecList(srcs,dest)                    @@\
  536. install::                                @@\
  537.     @case '${MFLAGS}' in *[i]*) set +e;; esac;             @@\
  538.     for i in srcs ;\                        @@\
  539.     do \                                @@\
  540.         echo "installing $$i"; \                @@\
  541.         $(RM) dest/$$i ; \                    @@\
  542.         $(INSTALL) -c $(INSTDATFLAGS) $$i dest ; \         @@\
  543.     done
  544. #endif /* InstallNonExecList */
  545.  
  546. /*
  547.  * InstallExampleSrcs - rule to install example sources.
  548.  */
  549. #ifndef InstallExampleSrcs
  550. #define InstallExampleSrcs(files,makefile,dest)                @@\
  551. install.srcs::                                @@\
  552.     @case '${MFLAGS}' in *[i]*) set +e;; esac;             @@\
  553.     for i in files ;\                        @@\
  554.     do \                                @@\
  555.         echo "installing $$i"; \                @@\
  556.         $(RM) dest/$$i ; \                    @@\
  557.         $(INSTALL) -c $(INSTDATFLAGS) $$i dest ; \         @@\
  558.     done                                 @@\
  559.     $(RM) dest/Makefile ;                         @@\
  560.     $(INSTALL) -c $(INSTDATFLAGS) makefile dest/Makefile 
  561. #endif /* InstallExampleSrcs */
  562.  
  563. /*
  564.  * InstallExampleSrcsNoMakefile - rule to install example sources that
  565.  * do not have Makefiles.
  566.  */
  567. #ifndef InstallExampleSrcsNoMakefile
  568. #define InstallExampleSrcsNoMakefile(files,dest)            @@\
  569. install.srcs::                                @@\
  570.     @case '${MFLAGS}' in *[i]*) set +e;; esac;             @@\
  571.     for i in files ;\                        @@\
  572.     do \                                @@\
  573.         echo "installing $$i"; \                @@\
  574.         $(RM) dest/$$i ; \                    @@\
  575.         $(INSTALL) -c $(INSTDATFLAGS) $$i dest ; \         @@\
  576.     done 
  577. #endif /* InstallExampleSrcsNoMakefile */
  578.  
  579. /*
  580.  * InstallSrcsSubdirs - generate rules to recursively install sources.
  581.  */
  582. #ifndef InstallSrcsSubdirs
  583. #define InstallSrcsSubdirs(dirs)                    @@\
  584. NamedTargetSubdirs(install.srcs,dirs,"installing srcs", /**/,install.srcs)
  585. #endif /* InstallSrcsSubdirs */
  586.  
  587.